#include<stdio.h>
#include<math.h>
#define HEIGHT 10               //sin函数的高度
#define WIDTH 30                //sin函数一个周期的长度
int main() {
    double x = M_PI/WIDTH*2;
    double y = 1.0/HEIGHT;
    double t1,t2;
    char a[2*HEIGHT+1][2*WIDTH];
    for(int i = 0;i<2*HEIGHT+1;i++) {
        for(int j = 0;j<WIDTH*2;j++) {
            a[i][j] = ' ';
            t1 = (HEIGHT-i)*y;
            t2 = (j%(WIDTH))*x;
            if(j%WIDTH>WIDTH/2&&t1>=sin(t2)&&(HEIGHT-i)<=0)a[i][j] = '*';
            if(j%WIDTH<=WIDTH/2&&t1<=sin(t2)&&(HEIGHT-i)>=0)a[i][j] = '*';
        }
    }
    for(int i = 0;i<HEIGHT*2+1;i++) {
        for(int j = 0;j<WIDTH*2;j++) {
            printf("%c",a[i][j]);
        }
        printf("\n");
    }
}